<html>
	<body style="background-color: #ccccaa">
		<span style="position:absolute;right:20;top:2;"><b id="version"></b><br> by Felipe Sanches<br> <a href="#" onclick="show_info();">Click here for more info.</a></span>
		<!--pre-loading the images:-->
		<img src="png/Cell.png" height="0" width="0" alt="">
		<img src="png/CellVoid.png" height="0" width="0" alt="">
		<img src="png/CellOne.png" height="0" width="0" alt="">
		<img src="png/CellTwo.png" height="0" width="0" alt="">
		<img src="png/CellThree.png" height="0" width="0" alt="">
		<img src="png/CellFour.png" height="0" width="0" alt="">
		<img src="png/CellFive.png" height="0" width="0" alt="">
		<img src="png/CellSix.png" height="0" width="0" alt="">
		<img src="png/CellBomb.png" height="0" width="0" alt="">
		<img src="png/CellBombExploded.png" height="0" width="0" alt="">
		<img src="png/CellFlag.png" height="0" width="0" alt="">
		<img src="png/CellWrongFlag.png" height="0" width="0" alt="">
	</body>
<script type='text/javascript' src='cell.js'></script>
<script type='text/javascript' src='board.js'></script>
<script language="javascript">
version = "2007-07-09";
n_players=1;
BASE_URL="";
var v=document.getElementById("version");
v.innerHTML="Hexamines v"+version;

document.oncontextmenu = function(evt){
	evt.stopPropagation();
}

win_width = document.body.clientWidth;
win_height = document.body.clientHeight

xmax = Math.floor((win_width-20)/32);
ymax = Math.floor((win_height-60*n_players)/32);

if (xmax<5) xmax = 5
if (ymax<5) ymax = 5

percentage = 0.2;

b=new Array;
m=new Array;

for (var i=0;i<n_players;i++){
	b[i] = new Board(xmax, ymax/n_players, percentage);

	m[i] = document.createElement("div");
	m[i].appendChild(b[i].div);
	m[i].style.position = "absolute";
	m[i].style.top=i*(win_height/n_players) + 60;
	document.body.appendChild(m[i]);
}

info = document.createElement("div");

function show_info(){
//	info = document.createElement("div");
	body = document.getElementsByTagName("body")[0];
	body.appendChild(info);
	info.id = "infobox";
	info.style.position = "relative";
	info.style.backgroundColor = "yellow";
	info.onclick = function(){body.removeChild(info)};

	info.innerHTML ="<font size=4><b>Hexagonal minefield</b><br>\
		version "+version+"<br>\
		<br>\
		<b>Code:</b><br>\
		(c)2007 Felipe Correa da Silva Sanches<br>\
		Licensed under GPLv3 or later<br>\
		<br>\
		<b>Artwork:</b><br>\
		(c)2007 Felipe Correa da Silva Sanches<br>\
		Licensed under Creative Commons Attribuition 3.0<br>\
		<br>\
		contact: <b>juca@usp.br</b><br>\
		<br>\
		<b>rules:</b><br>\
		* each nunber indicates the quantity of bombs on the neighbour cells.<br>\
		* you die if you open a cell containing a bomb.<br>\
		* right click to mark cell with a flag.<br>\
		* flags indicate the places where you think there is a bomb.<br>\
		* use middle click to open multiple cells at once.<br>\
		* middle click will only work after you mark the neighbour cells with the appropriate number of flags.<br>\
		<br>\
		<br>\
		<a href='hexamines-v"+version+".tar.gz'>get the source code!</a>\
		</font>";
}
</script>
<html>

